import logging

from bs4 import BeautifulSoup

def html_util(response):
    data = response.json()['description']['form']
    logging.info("从上一个接口获取到的响应数据:{}".format(data))
    beautifulsoup = BeautifulSoup(data,'html.parser')
    url = beautifulsoup.form.get('action')
    info_all = beautifulsoup.find_all('input')
    test_dict = {}
    for sample in info_all:
        key = sample['name']
        value = sample['value']
        test_dict[key] = value
    logging.info("获取的第三方请求数据:{}".format([url,test_dict]))
    return [url,test_dict]

